import java.util.Scanner;

public class WB {
    public static void main(String[]args) {
        String s2;
        String s3 = "";
        String s4 = new String();
        String s5;
        String s6 = new String();
        int a = 0;
        int i = 6;
        int count = 0;
        System.out.println("请输入需要处理的文本：");
        Scanner sca = new Scanner(System.in);
        String s1 = sca.next();
        while (true) {
            s2 = s1.substring(a, i + 1);
            if (i % 2 == 0) {
                s3 = s2 + '，';
            }
            if (i % 2 != 0) {
                s4 = s2 + '。';
                s5 = s3 + s4;
                System.out.println(s5);
            }
            a = i + 1;
            i += 7;
            if (i > 238) {
                break;
            }
        }
        s6 = s1.substring(238, s1.length());
        System.out.println(s6);

        //把字符串转换成字符，存入字符数组中
        char A[];
        A = s1.toCharArray();

        System.out.println("请输入一个需要检索次数的字：");
//         Scanner 输入语句用法
        Scanner scanner = new Scanner(System.in);
        String WB = scanner.next();
        char wb = WB.charAt(0);
        for (int I = 0; I < s1.length(); I++) {
            if (A[I] == wb) {
                count += 1;
            }

        }
       System.out.println("该字出现的次数为：" + count);
    }
}
